﻿#include "ssActor.h"


namespace StarSeeker
{

ssActor::ssActor()
	:m_id(0)
{
	m_enabled = 0;
	m_working = 0;
}

ssActor::~ssActor()
{
}

void ssActor::PushMsg(ssMsg_s &m)
{
	m_msgLock.Lock();
	m_msgList.PushBack(m);
	m_msgLock.Unlock();
}

bool ssActor::PopMsg(ssMsg_s &m)
{
	bool ret = false;
	m_msgLock.Lock();
	ret = m_msgList.PopFront(&m);
	m_msgLock.Unlock();
	return ret;
}

StarSeeker::ulint ssActor::GetMsgCount()
{
	return m_msgList.Count();
}

StarSeeker::u32 ssActor::GetID()
{
	return m_id;
}

bool ssActor::IsWorking()
{
	return m_working > 0;
}

}
